home *** CD-ROM | disk | FTP | other *** search
- Path: in2.uu.net!bounce-back
- Date: 10 Jan 96 23:20:34 GMT
- Approved: fjh@cs.mu.oz.au
- From: clamage@Eng.Sun.COM (Steve Clamage)
- Newsgroups: comp.std.c++
- Subject: Re: ambiguous or not ?
- X-Original-Date: 10 Jan 1996 22:24:53 GMT
- Organization: Sun Microsystems Inc.
- Message-ID: <4d1ebl$kn9@engnews1.Eng.Sun.COM>
- References: <199601101956.AA04691@hercules.iassf.easams.com.au>
- Reply-To: clamage@Eng.Sun.COM
- X-Auth: PGPMoose V1.1 PGP comp.std.c++
- iQBFAgUBMPRKn+EDnX0m9pzZAQG9pAGAkb/CKtSvYiSBpqIP16cbdzqIOymQd7xX
- TPitMMnjsIBuOIaLeDwdTe+aTNauuKrh
- =XOe+
-
- In article AA04691@hercules.iassf.easams.com.au, rjl@iassf.easams.com.au
- writes:
- >
- >Surely it is ill-formed, since char is implementation defined as either
- >unsigned char or signed char.
- >: S( char ) {
- >...
- >: S( unsigned char ) {
- >
- >Which means that on some platforms this means something and on others
- >it is a dupplicate definition.
-
- No. Type "char" has the same repesentation as either "signed char" or
- "unsigned char", but is a distinct type. You can overload on all three
- types:
- int foo(char) { ... }
- int foo(signed char) { ... }
- int foo(unsigned char) { ... }
-
- Similarly, type int often has the same representation as either type
- short or type long, but it is a distinct type.
-
- ---
- Steve Clamage, stephen.clamage@eng.sun.com
- ---
- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
- Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
- is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
-